import QtQuick 2.0
import QtQuick.Layouts

//Component{
Item{
    anchors.fill: parent

    property var smallCardInfo

    ListModel{//小卡片内容
        id:roomSmallCardInfo
        ListElement{
            title:"照明"
            img:"qrc:/icon/icon/leave_home.svg"
        }
        ListElement{
            title:"冷暖新风"
            img:"qrc:/icon/icon/leave_home.svg"
        }
        ListElement{
            title:"音乐"
            img:"qrc:/icon/icon/leave_home.svg"
        }
        ListElement{
            title:"遮阳"
            img:"qrc:/icon/icon/leave_home.svg"
        }
        ListElement{
            title:"家电"
            img:"qrc:/icon/icon/leave_home.svg"
        }
        ListElement{
            title:"家居家私"
            img:"qrc:/icon/icon/leave_home.svg"
        }
    }

    RowLayout {//上方卡片
        id: grid
        width: parent.width
        height: parent.height/18*13
        anchors.left: parent.left
        anchors.top: parent.top
        spacing: 20

        Item{//场景大卡片
            Layout.fillHeight:true
            Layout.preferredWidth: parent.width / 3
            BigCard{
                id: bigCardComponent
                btnConfigs: [
                    { text: "进入", img: "qrc:/icon/icon/m_back_home.svg" },
                    { text: "离开", img: "qrc:/icon/icon/m_leave_home.svg" },
                    { text: "烛光晚餐", img: "qrc:/icon/icon/m_thermometer.svg" },
                    { text: "休闲会客", img: "qrc:/icon/icon/m_dehumi.svg" },
                    { text: "温馨就餐", img: "qrc:/icon/icon/m_wind.svg" },
                    { text: "更多场景", img: "qrc:/icon/icon/m_more_scene.svg" },
                ]
            }
        }

        Rectangle{//6个小卡片
            Layout.fillHeight:true
            Layout.preferredWidth: parent.width * 2 / 3
            radius: 20
            color: "transparent"

            GridLayout{
                anchors.fill: parent
                columns: 3
                rows:2
                rowSpacing: 20
                columnSpacing: 20

                Repeater {
                    id:smallCardRepeater
                    model: roomSmallCardInfo

                    delegate: SmallCard {
                        Layout.row: index / 3
                        Layout.column: index % 3
                        title: model.title
                        img: model.img
                    }
                }
            }
        }
    }
    Rectangle{//间隔区域
        id: spacing1
        height: 10
        width: parent.width
        anchors.top: grid.bottom
        color:"transparent"
    }
    Dock{//底部功能栏
        id:dock
        width: parent.width
        height: parent.height/9*2
        anchors.bottom: parent.bottom
    }
}
//}
